.class Lcom/waiqin365/h5/photo/g;
.super Ljava/lang/Object;

# interfaces
.implements Ljava/lang/Runnable;


# instance fields
.field final synthetic a:Lcom/waiqin365/h5/photo/WqPhotoPreview;


# direct methods
.method constructor <init>(Lcom/waiqin365/h5/photo/WqPhotoPreview;)V
    .locals 0

    iput-object p1, p0, Lcom/waiqin365/h5/photo/g;->a:Lcom/waiqin365/h5/photo/WqPhotoPreview;

    invoke-direct {p0}, Ljava/lang/Object;-><init>()V

    return-void
.end method


# virtual methods
.method public run()V
    .locals 9

    const/4 v0, 0x0

    iget-object v1, p0, Lcom/waiqin365/h5/photo/g;->a:Lcom/waiqin365/h5/photo/WqPhotoPreview;

    invoke-static {v1}, Lcom/waiqin365/h5/photo/WqPhotoPreview;->a(Lcom/waiqin365/h5/photo/WqPhotoPreview;)Ljava/lang/String;

    move-result-object v1

    invoke-static {v1}, Landroid/text/TextUtils;->isEmpty(Ljava/lang/CharSequence;)Z

    move-result v1

    if-nez v1, :cond_9

    :try_start_0
    new-instance v2, Lorg/json/JSONObject;

    iget-object v1, p0, Lcom/waiqin365/h5/photo/g;->a:Lcom/waiqin365/h5/photo/WqPhotoPreview;

    invoke-static {v1}, Lcom/waiqin365/h5/photo/WqPhotoPreview;->a(Lcom/waiqin365/h5/photo/WqPhotoPreview;)Ljava/lang/String;

    move-result-object v1

    invoke-direct {v2, v1}, Lorg/json/JSONObject;-><init>(Ljava/lang/String;)V

    iget-object v3, p0, Lcom/waiqin365/h5/photo/g;->a:Lcom/waiqin365/h5/photo/WqPhotoPreview;

    const-string/jumbo v1, "position"

    invoke-virtual {v2, v1}, Lorg/json/JSONObject;->has(Ljava/lang/String;)Z

    move-result v1

    if-eqz v1, :cond_0

    const-string/jumbo v1, "position"

    invoke-virtual {v2, v1}, Lorg/json/JSONObject;->getInt(Ljava/lang/String;)I

    move-result v1

    :goto_0
    invoke-static {v3, v1}, Lcom/waiqin365/h5/photo/WqPhotoPreview;->a(Lcom/waiqin365/h5/photo/WqPhotoPreview;I)I

    iget-object v3, p0, Lcom/waiqin365/h5/photo/g;->a:Lcom/waiqin365/h5/photo/WqPhotoPreview;

    const-string/jumbo v1, "page_title"

    invoke-virtual {v2, v1}, Lorg/json/JSONObject;->has(Ljava/lang/String;)Z

    move-result v1

    if-eqz v1, :cond_1

    const-string/jumbo v1, "page_title"

    invoke-virtual {v2, v1}, Lorg/json/JSONObject;->getString(Ljava/lang/String;)Ljava/lang/String;

    move-result-object v1

    :goto_1
    invoke-static {v3, v1}, Lcom/waiqin365/h5/photo/WqPhotoPreview;->a(Lcom/waiqin365/h5/photo/WqPhotoPreview;Ljava/lang/String;)Ljava/lang/String;

    const-string/jumbo v1, "photos"

    invoke-virtual {v2, v1}, Lorg/json/JSONObject;->has(Ljava/lang/String;)Z

    move-result v1

    if-eqz v1, :cond_7

    const-string/jumbo v1, "photos"

    invoke-virtual {v2, v1}, Lorg/json/JSONObject;->getString(Ljava/lang/String;)Ljava/lang/String;

    move-result-object v1

    new-instance v6, Lorg/json/JSONArray;

    invoke-direct {v6, v1}, Lorg/json/JSONArray;-><init>(Ljava/lang/String;)V

    if-eqz v6, :cond_8

    invoke-virtual {v6}, Lorg/json/JSONArray;->length()I

    move-result v1

    if-lez v1, :cond_8

    move v5, v0

    :goto_2
    invoke-virtual {v6}, Lorg/json/JSONArray;->length()I

    move-result v0

    if-ge v5, v0, :cond_8

    invoke-virtual {v6, v5}, Lorg/json/JSONArray;->getJSONObject(I)Lorg/json/JSONObject;

    move-result-object v7

    new-instance v8, Ljava/util/HashMap;

    invoke-direct {v8}, Ljava/util/HashMap;-><init>()V

    const-string/jumbo v0, "path"

    invoke-virtual {v7, v0}, Lorg/json/JSONObject;->has(Ljava/lang/String;)Z

    move-result v0

    if-eqz v0, :cond_2

    const-string/jumbo v0, "path"

    invoke-virtual {v7, v0}, Lorg/json/JSONObject;->getString(Ljava/lang/String;)Ljava/lang/String;

    move-result-object v0

    move-object v4, v0

    :goto_3
    const-string/jumbo v0, "id"

    invoke-virtual {v7, v0}, Lorg/json/JSONObject;->has(Ljava/lang/String;)Z

    move-result v0

    if-eqz v0, :cond_3

    const-string/jumbo v0, "id"

    invoke-virtual {v7, v0}, Lorg/json/JSONObject;->getString(Ljava/lang/String;)Ljava/lang/String;

    move-result-object v0

    move-object v3, v0

    :goto_4
    const-string/jumbo v0, "img_title"

    invoke-virtual {v7, v0}, Lorg/json/JSONObject;->has(Ljava/lang/String;)Z

    move-result v0

    if-eqz v0, :cond_4

    const-string/jumbo v0, "img_title"

    invoke-virtual {v7, v0}, Lorg/json/JSONObject;->getString(Ljava/lang/String;)Ljava/lang/String;

    move-result-object v0

    move-object v2, v0

    :goto_5
    const-string/jumbo v0, "img_message"

    invoke-virtual {v7, v0}, Lorg/json/JSONObject;->has(Ljava/lang/String;)Z

    move-result v0

    if-eqz v0, :cond_5

    const-string/jumbo v0, "img_message"

    invoke-virtual {v7, v0}, Lorg/json/JSONObject;->getString(Ljava/lang/String;)Ljava/lang/String;

    move-result-object v0

    move-object v1, v0

    :goto_6
    const-string/jumbo v0, "title"

    invoke-virtual {v7, v0}, Lorg/json/JSONObject;->has(Ljava/lang/String;)Z

    move-result v0

    if-eqz v0, :cond_6

    const-string/jumbo v0, "title"

    invoke-virtual {v7, v0}, Lorg/json/JSONObject;->getString(Ljava/lang/String;)Ljava/lang/String;

    move-result-object v0

    :goto_7
    const-string/jumbo v7, "title"

    invoke-virtual {v8, v7, v0}, Ljava/util/HashMap;->put(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;

    const-string/jumbo v0, "path"

    invoke-virtual {v8, v0, v4}, Ljava/util/HashMap;->put(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;

    const-string/jumbo v0, "id"

    invoke-virtual {v8, v0, v3}, Ljava/util/HashMap;->put(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;

    const-string/jumbo v0, "img_title"

    invoke-virtual {v8, v0, v2}, Ljava/util/HashMap;->put(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;

    const-string/jumbo v0, "img_message"

    invoke-virtual {v8, v0, v1}, Ljava/util/HashMap;->put(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;

    iget-object v0, p0, Lcom/waiqin365/h5/photo/g;->a:Lcom/waiqin365/h5/photo/WqPhotoPreview;

    iget-object v0, v0, Lcom/waiqin365/h5/photo/WqPhotoPreview;->a:Ljava/util/ArrayList;

    invoke-virtual {v0, v8}, Ljava/util/ArrayList;->add(Ljava/lang/Object;)Z

    add-int/lit8 v0, v5, 0x1

    move v5, v0

    goto/16 :goto_2

    :cond_0
    move v1, v0

    goto/16 :goto_0

    :cond_1
    const-string/jumbo v1, ""

    goto/16 :goto_1

    :cond_2
    const-string/jumbo v0, ""

    move-object v4, v0

    goto :goto_3

    :cond_3
    const-string/jumbo v0, ""

    move-object v3, v0

    goto :goto_4

    :cond_4
    const-string/jumbo v0, ""

    move-object v2, v0

    goto :goto_5

    :cond_5
    const-string/jumbo v0, ""

    move-object v1, v0

    goto :goto_6

    :cond_6
    const-string/jumbo v0, ""

    goto :goto_7

    :cond_7
    iget-object v0, p0, Lcom/waiqin365/h5/photo/g;->a:Lcom/waiqin365/h5/photo/WqPhotoPreview;

    new-instance v1, Ljava/util/ArrayList;

    invoke-direct {v1}, Ljava/util/ArrayList;-><init>()V

    iput-object v1, v0, Lcom/waiqin365/h5/photo/WqPhotoPreview;->a:Ljava/util/ArrayList;
    :try_end_0
    .catch Lorg/json/JSONException; {:try_start_0 .. :try_end_0} :catch_0

    :cond_8
    :goto_8
    new-instance v0, Landroid/content/Intent;

    iget-object v1, p0, Lcom/waiqin365/h5/photo/g;->a:Lcom/waiqin365/h5/photo/WqPhotoPreview;

    invoke-static {v1}, Lcom/waiqin365/h5/photo/WqPhotoPreview;->b(Lcom/waiqin365/h5/photo/WqPhotoPreview;)Lorg/apache/cordova/WqCordovaActivity;

    move-result-object v1

    const-class v2, Lcom/waiqin365/h5/photo/acty/CameraPreviewActivity;

    invoke-direct {v0, v1, v2}, Landroid/content/Intent;-><init>(Landroid/content/Context;Ljava/lang/Class;)V

    const-string/jumbo v1, "position"

    iget-object v2, p0, Lcom/waiqin365/h5/photo/g;->a:Lcom/waiqin365/h5/photo/WqPhotoPreview;

    invoke-static {v2}, Lcom/waiqin365/h5/photo/WqPhotoPreview;->c(Lcom/waiqin365/h5/photo/WqPhotoPreview;)I

    move-result v2

    invoke-virtual {v0, v1, v2}, Landroid/content/Intent;->putExtra(Ljava/lang/String;I)Landroid/content/Intent;

    const-string/jumbo v1, "title"

    iget-object v2, p0, Lcom/waiqin365/h5/photo/g;->a:Lcom/waiqin365/h5/photo/WqPhotoPreview;

    invoke-static {v2}, Lcom/waiqin365/h5/photo/WqPhotoPreview;->d(Lcom/waiqin365/h5/photo/WqPhotoPreview;)Ljava/lang/String;

    move-result-object v2

    invoke-virtual {v0, v1, v2}, Landroid/content/Intent;->putExtra(Ljava/lang/String;Ljava/lang/String;)Landroid/content/Intent;

    iget-object v1, p0, Lcom/waiqin365/h5/photo/g;->a:Lcom/waiqin365/h5/photo/WqPhotoPreview;

    iget-object v1, v1, Lcom/waiqin365/h5/photo/WqPhotoPreview;->a:Ljava/util/ArrayList;

    sput-object v1, Lcom/waiqin365/h5/a;->a:Ljava/util/ArrayList;

    iget-object v1, p0, Lcom/waiqin365/h5/photo/g;->a:Lcom/waiqin365/h5/photo/WqPhotoPreview;

    invoke-static {v1}, Lcom/waiqin365/h5/photo/WqPhotoPreview;->b(Lcom/waiqin365/h5/photo/WqPhotoPreview;)Lorg/apache/cordova/WqCordovaActivity;

    move-result-object v1

    invoke-virtual {v1, v0}, Lorg/apache/cordova/WqCordovaActivity;->startActivity(Landroid/content/Intent;)V

    iget-object v0, p0, Lcom/waiqin365/h5/photo/g;->a:Lcom/waiqin365/h5/photo/WqPhotoPreview;

    invoke-static {v0}, Lcom/waiqin365/h5/photo/WqPhotoPreview;->e(Lcom/waiqin365/h5/photo/WqPhotoPreview;)Lorg/apache/cordova/CallbackContext;

    move-result-object v0

    invoke-virtual {v0}, Lorg/apache/cordova/CallbackContext;->success()V

    :cond_9
    return-void

    :catch_0
    move-exception v0

    invoke-virtual {v0}, Lorg/json/JSONException;->printStackTrace()V

    goto :goto_8
.end method
